<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/financier.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListComptesTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form >
                <p:dataTable value="#{comptesController.items}" var="item" id="tableId" paginator="true" rows="10">
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListComptesTitle_nomCompte}"/>
                        </f:facet>
                        <h:outputText value="#{item.nomCompte}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListComptesTitle_banque}"/>
                        </f:facet>
                        <h:outputText value="#{item.banque.nomBanque}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListComptesTitle_soldeCompte}"/>
                        </f:facet>
                        <h:outputText value="#{item.soldeCompte}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListComptesTitle_typeCompte}"/>
                        </f:facet>
                        <h:outputText value="#{item.typeCompte.typeCompte}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="&nbsp;"/>
                        </f:facet>
                        <h:commandLink action="#{comptesController.prepareView}" value="#{bundle.ListComptesViewLink}"/>
                        <h:outputText value=" "/>
                        <h:commandLink action="#{comptesController.prepareEdit}" value="#{bundle.ListComptesEditLink}"/>
                        <h:outputText value=" "/>
                        <h:commandLink action="#{comptesController.destroy}" value="#{bundle.ListComptesDestroyLink}"/>
                    </p:column>
                </p:dataTable>
                <h:commandLink>
                    <p:graphicImage value="/resources/images/icones/XLS.png" />
                    <p:dataExporter type="xls" target="tableId" fileName="Comptes" excludeColumns="4" />
                </h:commandLink>
                <h:commandLink>
                    <p:graphicImage value="/resources/images/icones/PDF.png" />
                    <p:dataExporter type="pdf" target="tableId" fileName="Comptes" excludeColumns="4" />
                </h:commandLink>
                <h:commandLink>
                    <p:graphicImage value="/resources/images/icones/CSV.png" />
                    <p:dataExporter type="csv" target="tableId" fileName="Comptes" excludeColumns="4" />
                </h:commandLink>
                <h:commandLink>
                    <p:graphicImage value="/resources/images/icones/XML.png" />
                    <p:dataExporter type="xml" target="tableId" fileName="Comptes" excludeColumns="4" />
                </h:commandLink>
                <br />
                <h:commandLink action="#{comptesController.prepareCreate}" value="#{bundle.ListComptesCreateLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
